package image;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Test {

	public static void main(String[] args) throws IOException {
		
		BufferedImage image = new BufferedImage(300, 100, BufferedImage.TYPE_INT_BGR);
		Graphics graphics = image.getGraphics();
		graphics.setColor(Color.GREEN);
		graphics.fillRect(0, 0, 100, 100);
		graphics.setColor(Color.RED);
		graphics.setFont(new Font(Font.SERIF, Font.TYPE1_FONT, 25));
		graphics.drawString("1234", 0, 100);
		File file = new File("test.png");
		ImageIO.write(image, "png", file);
	}
}
